package com.investmenttechnologyservices.datadictionary;

import java.util.HashMap;
import java.util.Map;

public class EntityMetadataBuilder {
	private String kind;
	private boolean longId = true;
	private String parent;
	private boolean parentLongId;
	private Map<String,FieldMetadata> fields = new HashMap<String, FieldMetadata>();
	
	public EntityMetadataBuilder setKind(String kind) {
		this.kind = kind;
		return this;
	}

	public EntityMetadataBuilder setLongId(boolean longId) {
		this.longId = longId;
		return this;
	}
	
	public EntityMetadataBuilder setField(String name, FieldType fieldType) {
		fields.put(name, new FieldMetadata(name, fieldType));
		return this;
	}
	
	public EntityMetadataBuilder setParent(String name) {
		parent = name;
		return this;
	}

	public EntityMetadataBuilder setParentLongId(boolean parentLongId) {
		this.parentLongId = parentLongId;
		return this;
	}

	public EntityMetadata build() {
		return new EntityMetadata(kind, longId, fields, parent, parentLongId);
	}
}
